﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_COOPERATION_ORDER
// * CreateDate    : 2012/5/2 15:00:15
// * Creater       : CodeSmith
// * LastChangeDate: 2012/5/2 15:00:15
// * LastChanger   : 2012/5/2 15:00:15
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class ProdCooperationOrderEntity : EntityBase
    {
        public ProdCooperationOrderTable TableSchema
        {
            get
            {
                return ProdCooperationOrderTable.Current;
            }
        }

        public ProdCooperationOrderEntity()
        {

        }

        public ProdCooperationOrderEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.OrderId = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_ID"]));
            this.ProductTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TECHNIC_ID"]));
            this.OrderCode = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_CODE"]));
            this.Status = Convert.ToInt32(CommonFunctions.ToObject(dr["STATUS"]));
            this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
            this.SupplierName = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_NAME"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.UnitPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_PRICE"]));
            this.TotalPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_PRICE"]));
            this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.PlanDeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_DELIVERY_DATE"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
            this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
        }

        public ProdCooperationOrderEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.OrderId = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_ID"]));
            this.ProductTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TECHNIC_ID"]));
            this.OrderCode = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_CODE"]));
            this.Status = Convert.ToInt32(CommonFunctions.ToObject(dr["STATUS"]));
            this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
            this.SupplierName = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_NAME"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.UnitPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_PRICE"]));
            this.TotalPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_PRICE"]));
            this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.PlanDeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_DELIVERY_DATE"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
            this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdCooperationOrderTable.Current;
            }
        }

        #region Perporty List
        public string OrderId
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_ORDER_ID)); }
            set { SetData(ProdCooperationOrderTable.C_ORDER_ID, value); }
        }

        public string ProductTechnicId
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_PRODUCT_TECHNIC_ID)); }
            set { SetData(ProdCooperationOrderTable.C_PRODUCT_TECHNIC_ID, value); }
        }

        public string OrderCode
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_ORDER_CODE)); }
            set { SetData(ProdCooperationOrderTable.C_ORDER_CODE, value); }
        }

        public int Status
        {
            get { return Convert.ToInt32(GetData(ProdCooperationOrderTable.C_STATUS)); }
            set { SetData(ProdCooperationOrderTable.C_STATUS, value); }
        }

        public string SupplierId
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_SUPPLIER_ID)); }
            set { SetData(ProdCooperationOrderTable.C_SUPPLIER_ID, value); }
        }

        public string SupplierName
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_SUPPLIER_NAME)); }
            set { SetData(ProdCooperationOrderTable.C_SUPPLIER_NAME, value); }
        }

        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(ProdCooperationOrderTable.C_QTY)); }
            set { SetData(ProdCooperationOrderTable.C_QTY, value); }
        }

        public decimal UnitPrice
        {
            get { return Convert.ToDecimal(GetData(ProdCooperationOrderTable.C_UNIT_PRICE)); }
            set { SetData(ProdCooperationOrderTable.C_UNIT_PRICE, value); }
        }

        public decimal TotalPrice
        {
            get { return Convert.ToDecimal(GetData(ProdCooperationOrderTable.C_TOTAL_PRICE)); }
            set { SetData(ProdCooperationOrderTable.C_TOTAL_PRICE, value); }
        }

        public decimal Weight
        {
            get { return Convert.ToDecimal(GetData(ProdCooperationOrderTable.C_WEIGHT)); }
            set { SetData(ProdCooperationOrderTable.C_WEIGHT, value); }
        }

        public string Remark
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_REMARK)); }
            set { SetData(ProdCooperationOrderTable.C_REMARK, value); }
        }

        public DateTime PlanDeliveryDate
        {
            get { return Convert.ToDateTime(GetData(ProdCooperationOrderTable.C_PLAN_DELIVERY_DATE)); }
            set { SetData(ProdCooperationOrderTable.C_PLAN_DELIVERY_DATE, value); }
        }

        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(ProdCooperationOrderTable.C_CREATED_DATE)); }
            set { SetData(ProdCooperationOrderTable.C_CREATED_DATE, value); }
        }

        public string CreatedBy
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_CREATED_BY)); }
            set { SetData(ProdCooperationOrderTable.C_CREATED_BY, value); }
        }

        public DateTime LastModifiedDate
        {
            get { return Convert.ToDateTime(GetData(ProdCooperationOrderTable.C_LAST_MODIFIED_DATE)); }
            set { SetData(ProdCooperationOrderTable.C_LAST_MODIFIED_DATE, value); }
        }

        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_LAST_MODIFIED_BY)); }
            set { SetData(ProdCooperationOrderTable.C_LAST_MODIFIED_BY, value); }
        }

        public DateTime ApprovedDate
        {
            get { return Convert.ToDateTime(GetData(ProdCooperationOrderTable.C_APPROVED_DATE)); }
            set { SetData(ProdCooperationOrderTable.C_APPROVED_DATE, value); }
        }

        public string ApprovedBy
        {
            get { return Convert.ToString(GetData(ProdCooperationOrderTable.C_APPROVED_BY)); }
            set { SetData(ProdCooperationOrderTable.C_APPROVED_BY, value); }
        }

        #endregion
    }


}

